<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id
 * @property int $phone
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 */
class UncodePhoneSettings extends Model
{

    protected $table = 'uncode_phone_settings';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['id','phone', 'created_at', 'updated_at'];

    /**
     * 检查手机号是否免登录
     * @return array
     */
    public static function checkUncodePhone($phone){
        $data = self::where('phone', $phone)->get()->toArray();

        if (empty($data))
	{
           return false;
	} else {
           return true;
        }
    }
}
